<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title>Coidgen</title>
</head>
<body
 style="color: rgb(80, 0, 0); background-color: rgb(255, 255, 240);"
 alink="#000099" link="#500000" vlink="#990099">
<div style="text-align: center;">
<h1>Coidgen &nbsp;&nbsp; -&nbsp;&nbsp; generator for COID</h1>
<div style="text-align: left;"><br>
Programmers will appreciate they
don't have to learn any special
language or file format to produce coid services/devices. Only a few
decorations (these are defined as empty C defines) in your header file
are required. This tool generates whole communication layer for
client and server from information found in that header. It does not
write to it.<br>
<br>
<span style="font-weight: bold;">Usage</span> is
simple:&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; coidgen&nbsp; [-f]
[-m] [-n] [-M] [-N] my_service.h [file.dev]<br>
Options:<br>
<div style="margin-left: 40px;"><span style="font-weight: bold;">-f</span>
- force coidgen to generate
all required files even if service header is older than these files.<br>
<span style="font-weight: bold;">-m</span> - do not increment major
version (even if it should be incremented)<br>
<span style="font-weight: bold;">-n</span> - do not increment minor
version (even if it should be incremented)<br>
<span style="font-weight: bold;">-M</span> - increment major version<br>
<span style="font-weight: bold;">-N</span> - increment minor version<br>
<br>
</div>
&nbsp;&nbsp;&nbsp; By default, version of the service is extracted from
dispatch file,
methods in service header are compared against methods stored in
dispatch and
version is increased. You may want to compare your header file with an
older release and make another release that might have only minor
version changed (against your older release). In this case, use your <span
 style="font-weight: bold;">device.dev</span> as the last argument.
Every
.dev file stores information about its methods, so coidgen
can extract version information from it, compare methods and increase
major or minor version accordingly.<br>
<span style="font-weight: bold;"><br>
For example:</span> your last
release
version
is 2.3.20 (major.minor.build). Then you work on it and get version
7.1.40. If you then tell coidgen to use your old .dev file, it changes
version 2.3.20 according to difference between methods to one of these:
3.0.41
(major changes detected), 2.4.41 (minor changes detected) or 2.3.41 (no
changes detected).<br>
All these version or methods information stored in dispatch file are in
a hexadecimal form and any change to it can crash coidgen :) So if you
change it you do it on your own risk.<span style="font-weight: bold;"><br>
<br>
Output</span> of coidgen is a set of files for client (directory called
'client' is created for them) and one file for service (resides in the
same directory as the service header).<br>
Let's take a closer look at them. <span style="font-weight: bold;">Client
files</span> are postfixed with <span style="font-style: italic;">_client</span>,
e.g. my_service_client.h and my_service_client.cpp. Header contains
declaration of class you use in client to communicate with server. It's
name is the name of your original class postfixed by _client, too.
Source file (_client.cpp) implements methods as calls to server over
network. There is actually a little bit more code, but it's required to
support direct calls to server objects
(i.e. if client resides on server, it's not too smart to call methods
using network interface).<br>
<span style="font-weight: bold;"><br>
Server file</span>'s name (its a
source file) is postfixed with <span style="font-style: italic;">_dispatch</span>.
You should compile and link your device with it (you can link more
dispatch files
if you want to have more services in device). Server can find all
services in the device file then. Dispatch itself does the opposite of
what client does - extracts data from stream, fills variables required
for a method call and finally calls the requested method.<br>
<br>
For more information, see <a
 href="../generating_communication_layer.html">generating
communication layer</a>.<br>
</div>
<div style="text-align: left;"><br>
</div>
</div>
</body>
</html>
